package com.situ.day5;

public class Rectangle {
    private double width;
    private double height;

    //构造方法重载
    public Rectangle() {
        //width = 1;
        //height = 1;
        this(1);//调用当前类的其他构造方法 new Rantangle(int width)
    }

    public Rectangle(double width) {
        super();//调取父类无参构造方法 new Object();
        //this:代表当前类对象
        this.width = width;
        this.height = width;
    }

    public Rectangle(double width, double height) {
        super();
        this.width = width;
        this.height = height;
    }

    public double zhouChang() {
        return (width + height) * 2;
    }

    public double mianJi() {
        return width * height;
    }

    @Override
    public String toString() {
        //super代表父类对象
        return super.toString();
    }

    void show(int a, char b, double c){ }

    //'show(int, char, double)' is already defined in 'com.situ.day5.Rectangle'
    //void show(int x, char y, double z){}

    int show(int a, double c, char b){
        return 0;
    }
}
